<template>
  <div class="left-container">
    <h3>Left 组件 {{ msg }} -- {{ count }}</h3>
    <button @click="add">+1</button>
  </div>
</template>

<script>
import eventBus from '../utils/eventBus'
export default {
  data() {
    return {
      count: 1
    }
  },
  props: {
    msg: String
  },
  methods: {
    add() {
      this.count++
      this.$emit('countChange', this.count)
      eventBus.$emit('share', this.count)
    }
  }
}
</script>

<style lang="less">
.left-container {
  padding: 0 20px 20px;
  background-color: orange;
  min-height: 250px;
  flex: 1;
}
</style>
